<%@page
import="web.User"
import="web.Users"
import="web.Topic"
import="java.util.*"
import="web.Posts"
language="java"
contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<body>
  

<%
List<Posts> posts=(List<Posts>)request.getAttribute("posts");
User u=(User)request.getAttribute("user");
int nowpage=(Integer)request.getAttribute("nowpage");
int pagesize=(Integer)request.getAttribute("pagesize");
int tid=(Integer)request.getAttribute("tid");
%>

<table>
<%for(Posts post:posts){ %>
	<tr>
	<td><%=post.getUser().getUname() %></td>
	<td><%=post.getCont() %></td>
	<td><%=post.getCreate_time() %></td>
	</tr>
<%} %>
</table>

<form action="post_.do" method="get">
<%if(u!=null){ %>
	<p><textarea name="cont"></textarea></p>
	<p><input type="submit"></p>
	<p><input type="hidden" name="tid" value="<%=tid%>"></p>
<%} %>
<a href="bbs.do">返回首页</a>
</form>
<p>
第<%=nowpage %>页
<%for(int i=1;i<=pagesize;i++){ %>
	<a href="post.do?tid=<%=tid %>&p=<%=i %>"><%=i %></a>
<%} %>
共<%=pagesize %>页
</p>